Add hover buttons to recipe cards #1577
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's changed?
Add working hover buttons to recipe cards. The 'view' button takes you to the source article for the recipe (
canonicalArticle
).I didn't add Ophan – but perhaps that could also refer to the article?
Implementation notes
This includes a refactor of the hover states to factor out the code that reasons about URLs into the parts of the app that care about them. The problem was that this code didn't know about recipes, and it didn't feel appropriate for a simple hover button to know so much about parts of the app that we know change at a different cadence. The new API is hopefully a little simpler and more idiomatic – opinions welcome.
Tested locally with Fronts and Editions cards of article and snaplink, as well as our new recipe cards.
Checklist
General
Client